package com.dkm.biz.ou.repository.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.context.annotation.EnableLoadTimeWeaving;
import org.springframework.stereotype.Repository;

import com.dkm.base.core.helper.SpringHelper;
import com.dkm.base.db.persistence.dao.IQueryDao;
import com.dkm.biz.repository.AbstractRepository;
import com.dkm.biz.ou.domain.ShopFollow;
import com.dkm.biz.ou.repository.ShopFollowRepository;
import com.dkm.biz.ou.persistence.dao.ShopFollowQueryDao;
import com.dkm.biz.ou.persistence.entity.ShopFollowPo;

/**
 * 对象功能:t_ou_shop_follow Repository接口的实现类
 * 开发公司:dkm.com
 * 开发人员:ZHH
 * 创建时间:2017-07-31 20:05:14
 */
@Repository
public class ShopFollowRepositoryImpl extends AbstractRepository<String, ShopFollowPo,ShopFollow> implements ShopFollowRepository{
	  
	@Resource
	private  ShopFollowQueryDao shopFollowQueryDao;

	public ShopFollow newInstance() {
		ShopFollowPo po = new ShopFollowPo();
		ShopFollow shopFollow = SpringHelper.getBean(ShopFollow.class);
		shopFollow.setData(po);
		return shopFollow;
	}

	public ShopFollow newInstance(ShopFollowPo po) {
		ShopFollow shopFollow = SpringHelper.getBean(ShopFollow.class);
		shopFollow.setData(po);
		return shopFollow;
	} 
	
	@Override
	protected IQueryDao<String, ShopFollowPo> getQueryDao() {
		return shopFollowQueryDao;
	}

	@Override
	public List<ShopFollowPo> findByShopId(String userId, String shopId) {
		Map<String, Object> params = new HashMap<>();
		params.put("whereSql", "party_id_='"+userId+"' and shop_id_='"+shopId+"'");
		return findAll(params);
	}
	
}
 